// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file iridiumsbd_status.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "iridiumsbd_status.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

iridiumsbd_status::iridiumsbd_status()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f970963
    m_timestamp_ = 0;
    // m_last_heartbeat_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@887af79
    m_last_heartbeat_ = 0;
    // m_tx_buf_write_index_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fac631b
    m_tx_buf_write_index_ = 0;
    // m_rx_buf_read_index_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5b87ed94
    m_rx_buf_read_index_ = 0;
    // m_rx_buf_end_index_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e0e048a
    m_rx_buf_end_index_ = 0;
    // m_failed_sbd_sessions_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5bc79255
    m_failed_sbd_sessions_ = 0;
    // m_successful_sbd_sessions_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@47ef968d
    m_successful_sbd_sessions_ = 0;
    // m_num_tx_buf_reset_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23e028a9
    m_num_tx_buf_reset_ = 0;
    // m_signal_quality_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3dd4520b
    m_signal_quality_ = 0;
    // m_state_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5ae63ade
    m_state_ = 0;
    // m_ring_pending_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@610694f1
    m_ring_pending_ = false;
    // m_tx_buf_write_pending_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@43814d18
    m_tx_buf_write_pending_ = false;
    // m_tx_session_pending_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5c5a1b69
    m_tx_session_pending_ = false;
    // m_rx_read_pending_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3701eaf6
    m_rx_read_pending_ = false;
    // m_rx_session_pending_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@627551fb
    m_rx_session_pending_ = false;

}

iridiumsbd_status::~iridiumsbd_status()
{















}

iridiumsbd_status::iridiumsbd_status(const iridiumsbd_status &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_last_heartbeat_ = x.m_last_heartbeat_;
    m_tx_buf_write_index_ = x.m_tx_buf_write_index_;
    m_rx_buf_read_index_ = x.m_rx_buf_read_index_;
    m_rx_buf_end_index_ = x.m_rx_buf_end_index_;
    m_failed_sbd_sessions_ = x.m_failed_sbd_sessions_;
    m_successful_sbd_sessions_ = x.m_successful_sbd_sessions_;
    m_num_tx_buf_reset_ = x.m_num_tx_buf_reset_;
    m_signal_quality_ = x.m_signal_quality_;
    m_state_ = x.m_state_;
    m_ring_pending_ = x.m_ring_pending_;
    m_tx_buf_write_pending_ = x.m_tx_buf_write_pending_;
    m_tx_session_pending_ = x.m_tx_session_pending_;
    m_rx_read_pending_ = x.m_rx_read_pending_;
    m_rx_session_pending_ = x.m_rx_session_pending_;
}

iridiumsbd_status::iridiumsbd_status(iridiumsbd_status &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_last_heartbeat_ = x.m_last_heartbeat_;
    m_tx_buf_write_index_ = x.m_tx_buf_write_index_;
    m_rx_buf_read_index_ = x.m_rx_buf_read_index_;
    m_rx_buf_end_index_ = x.m_rx_buf_end_index_;
    m_failed_sbd_sessions_ = x.m_failed_sbd_sessions_;
    m_successful_sbd_sessions_ = x.m_successful_sbd_sessions_;
    m_num_tx_buf_reset_ = x.m_num_tx_buf_reset_;
    m_signal_quality_ = x.m_signal_quality_;
    m_state_ = x.m_state_;
    m_ring_pending_ = x.m_ring_pending_;
    m_tx_buf_write_pending_ = x.m_tx_buf_write_pending_;
    m_tx_session_pending_ = x.m_tx_session_pending_;
    m_rx_read_pending_ = x.m_rx_read_pending_;
    m_rx_session_pending_ = x.m_rx_session_pending_;
}

iridiumsbd_status& iridiumsbd_status::operator=(const iridiumsbd_status &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_last_heartbeat_ = x.m_last_heartbeat_;
    m_tx_buf_write_index_ = x.m_tx_buf_write_index_;
    m_rx_buf_read_index_ = x.m_rx_buf_read_index_;
    m_rx_buf_end_index_ = x.m_rx_buf_end_index_;
    m_failed_sbd_sessions_ = x.m_failed_sbd_sessions_;
    m_successful_sbd_sessions_ = x.m_successful_sbd_sessions_;
    m_num_tx_buf_reset_ = x.m_num_tx_buf_reset_;
    m_signal_quality_ = x.m_signal_quality_;
    m_state_ = x.m_state_;
    m_ring_pending_ = x.m_ring_pending_;
    m_tx_buf_write_pending_ = x.m_tx_buf_write_pending_;
    m_tx_session_pending_ = x.m_tx_session_pending_;
    m_rx_read_pending_ = x.m_rx_read_pending_;
    m_rx_session_pending_ = x.m_rx_session_pending_;

    return *this;
}

iridiumsbd_status& iridiumsbd_status::operator=(iridiumsbd_status &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_last_heartbeat_ = x.m_last_heartbeat_;
    m_tx_buf_write_index_ = x.m_tx_buf_write_index_;
    m_rx_buf_read_index_ = x.m_rx_buf_read_index_;
    m_rx_buf_end_index_ = x.m_rx_buf_end_index_;
    m_failed_sbd_sessions_ = x.m_failed_sbd_sessions_;
    m_successful_sbd_sessions_ = x.m_successful_sbd_sessions_;
    m_num_tx_buf_reset_ = x.m_num_tx_buf_reset_;
    m_signal_quality_ = x.m_signal_quality_;
    m_state_ = x.m_state_;
    m_ring_pending_ = x.m_ring_pending_;
    m_tx_buf_write_pending_ = x.m_tx_buf_write_pending_;
    m_tx_session_pending_ = x.m_tx_session_pending_;
    m_rx_read_pending_ = x.m_rx_read_pending_;
    m_rx_session_pending_ = x.m_rx_session_pending_;

    return *this;
}

size_t iridiumsbd_status::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);



    return current_alignment - initial_alignment;
}

size_t iridiumsbd_status::getCdrSerializedSize(const iridiumsbd_status& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);



    return current_alignment - initial_alignment;
}

void iridiumsbd_status::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_last_heartbeat_;
    scdr << m_tx_buf_write_index_;
    scdr << m_rx_buf_read_index_;
    scdr << m_rx_buf_end_index_;
    scdr << m_failed_sbd_sessions_;
    scdr << m_successful_sbd_sessions_;
    scdr << m_num_tx_buf_reset_;
    scdr << m_signal_quality_;
    scdr << m_state_;
    scdr << m_ring_pending_;
    scdr << m_tx_buf_write_pending_;
    scdr << m_tx_session_pending_;
    scdr << m_rx_read_pending_;
    scdr << m_rx_session_pending_;
}

void iridiumsbd_status::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_last_heartbeat_;
    dcdr >> m_tx_buf_write_index_;
    dcdr >> m_rx_buf_read_index_;
    dcdr >> m_rx_buf_end_index_;
    dcdr >> m_failed_sbd_sessions_;
    dcdr >> m_successful_sbd_sessions_;
    dcdr >> m_num_tx_buf_reset_;
    dcdr >> m_signal_quality_;
    dcdr >> m_state_;
    dcdr >> m_ring_pending_;
    dcdr >> m_tx_buf_write_pending_;
    dcdr >> m_tx_session_pending_;
    dcdr >> m_rx_read_pending_;
    dcdr >> m_rx_session_pending_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void iridiumsbd_status::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t iridiumsbd_status::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& iridiumsbd_status::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member last_heartbeat_
 * @param _last_heartbeat_ New value for member last_heartbeat_
 */
void iridiumsbd_status::last_heartbeat_(uint64_t _last_heartbeat_)
{
m_last_heartbeat_ = _last_heartbeat_;
}

/*!
 * @brief This function returns the value of member last_heartbeat_
 * @return Value of member last_heartbeat_
 */
uint64_t iridiumsbd_status::last_heartbeat_() const
{
    return m_last_heartbeat_;
}

/*!
 * @brief This function returns a reference to member last_heartbeat_
 * @return Reference to member last_heartbeat_
 */
uint64_t& iridiumsbd_status::last_heartbeat_()
{
    return m_last_heartbeat_;
}

/*!
 * @brief This function sets a value in member tx_buf_write_index_
 * @param _tx_buf_write_index_ New value for member tx_buf_write_index_
 */
void iridiumsbd_status::tx_buf_write_index_(uint16_t _tx_buf_write_index_)
{
m_tx_buf_write_index_ = _tx_buf_write_index_;
}

/*!
 * @brief This function returns the value of member tx_buf_write_index_
 * @return Value of member tx_buf_write_index_
 */
uint16_t iridiumsbd_status::tx_buf_write_index_() const
{
    return m_tx_buf_write_index_;
}

/*!
 * @brief This function returns a reference to member tx_buf_write_index_
 * @return Reference to member tx_buf_write_index_
 */
uint16_t& iridiumsbd_status::tx_buf_write_index_()
{
    return m_tx_buf_write_index_;
}

/*!
 * @brief This function sets a value in member rx_buf_read_index_
 * @param _rx_buf_read_index_ New value for member rx_buf_read_index_
 */
void iridiumsbd_status::rx_buf_read_index_(uint16_t _rx_buf_read_index_)
{
m_rx_buf_read_index_ = _rx_buf_read_index_;
}

/*!
 * @brief This function returns the value of member rx_buf_read_index_
 * @return Value of member rx_buf_read_index_
 */
uint16_t iridiumsbd_status::rx_buf_read_index_() const
{
    return m_rx_buf_read_index_;
}

/*!
 * @brief This function returns a reference to member rx_buf_read_index_
 * @return Reference to member rx_buf_read_index_
 */
uint16_t& iridiumsbd_status::rx_buf_read_index_()
{
    return m_rx_buf_read_index_;
}

/*!
 * @brief This function sets a value in member rx_buf_end_index_
 * @param _rx_buf_end_index_ New value for member rx_buf_end_index_
 */
void iridiumsbd_status::rx_buf_end_index_(uint16_t _rx_buf_end_index_)
{
m_rx_buf_end_index_ = _rx_buf_end_index_;
}

/*!
 * @brief This function returns the value of member rx_buf_end_index_
 * @return Value of member rx_buf_end_index_
 */
uint16_t iridiumsbd_status::rx_buf_end_index_() const
{
    return m_rx_buf_end_index_;
}

/*!
 * @brief This function returns a reference to member rx_buf_end_index_
 * @return Reference to member rx_buf_end_index_
 */
uint16_t& iridiumsbd_status::rx_buf_end_index_()
{
    return m_rx_buf_end_index_;
}

/*!
 * @brief This function sets a value in member failed_sbd_sessions_
 * @param _failed_sbd_sessions_ New value for member failed_sbd_sessions_
 */
void iridiumsbd_status::failed_sbd_sessions_(uint16_t _failed_sbd_sessions_)
{
m_failed_sbd_sessions_ = _failed_sbd_sessions_;
}

/*!
 * @brief This function returns the value of member failed_sbd_sessions_
 * @return Value of member failed_sbd_sessions_
 */
uint16_t iridiumsbd_status::failed_sbd_sessions_() const
{
    return m_failed_sbd_sessions_;
}

/*!
 * @brief This function returns a reference to member failed_sbd_sessions_
 * @return Reference to member failed_sbd_sessions_
 */
uint16_t& iridiumsbd_status::failed_sbd_sessions_()
{
    return m_failed_sbd_sessions_;
}

/*!
 * @brief This function sets a value in member successful_sbd_sessions_
 * @param _successful_sbd_sessions_ New value for member successful_sbd_sessions_
 */
void iridiumsbd_status::successful_sbd_sessions_(uint16_t _successful_sbd_sessions_)
{
m_successful_sbd_sessions_ = _successful_sbd_sessions_;
}

/*!
 * @brief This function returns the value of member successful_sbd_sessions_
 * @return Value of member successful_sbd_sessions_
 */
uint16_t iridiumsbd_status::successful_sbd_sessions_() const
{
    return m_successful_sbd_sessions_;
}

/*!
 * @brief This function returns a reference to member successful_sbd_sessions_
 * @return Reference to member successful_sbd_sessions_
 */
uint16_t& iridiumsbd_status::successful_sbd_sessions_()
{
    return m_successful_sbd_sessions_;
}

/*!
 * @brief This function sets a value in member num_tx_buf_reset_
 * @param _num_tx_buf_reset_ New value for member num_tx_buf_reset_
 */
void iridiumsbd_status::num_tx_buf_reset_(uint16_t _num_tx_buf_reset_)
{
m_num_tx_buf_reset_ = _num_tx_buf_reset_;
}

/*!
 * @brief This function returns the value of member num_tx_buf_reset_
 * @return Value of member num_tx_buf_reset_
 */
uint16_t iridiumsbd_status::num_tx_buf_reset_() const
{
    return m_num_tx_buf_reset_;
}

/*!
 * @brief This function returns a reference to member num_tx_buf_reset_
 * @return Reference to member num_tx_buf_reset_
 */
uint16_t& iridiumsbd_status::num_tx_buf_reset_()
{
    return m_num_tx_buf_reset_;
}

/*!
 * @brief This function sets a value in member signal_quality_
 * @param _signal_quality_ New value for member signal_quality_
 */
void iridiumsbd_status::signal_quality_(uint8_t _signal_quality_)
{
m_signal_quality_ = _signal_quality_;
}

/*!
 * @brief This function returns the value of member signal_quality_
 * @return Value of member signal_quality_
 */
uint8_t iridiumsbd_status::signal_quality_() const
{
    return m_signal_quality_;
}

/*!
 * @brief This function returns a reference to member signal_quality_
 * @return Reference to member signal_quality_
 */
uint8_t& iridiumsbd_status::signal_quality_()
{
    return m_signal_quality_;
}

/*!
 * @brief This function sets a value in member state_
 * @param _state_ New value for member state_
 */
void iridiumsbd_status::state_(uint8_t _state_)
{
m_state_ = _state_;
}

/*!
 * @brief This function returns the value of member state_
 * @return Value of member state_
 */
uint8_t iridiumsbd_status::state_() const
{
    return m_state_;
}

/*!
 * @brief This function returns a reference to member state_
 * @return Reference to member state_
 */
uint8_t& iridiumsbd_status::state_()
{
    return m_state_;
}

/*!
 * @brief This function sets a value in member ring_pending_
 * @param _ring_pending_ New value for member ring_pending_
 */
void iridiumsbd_status::ring_pending_(bool _ring_pending_)
{
m_ring_pending_ = _ring_pending_;
}

/*!
 * @brief This function returns the value of member ring_pending_
 * @return Value of member ring_pending_
 */
bool iridiumsbd_status::ring_pending_() const
{
    return m_ring_pending_;
}

/*!
 * @brief This function returns a reference to member ring_pending_
 * @return Reference to member ring_pending_
 */
bool& iridiumsbd_status::ring_pending_()
{
    return m_ring_pending_;
}

/*!
 * @brief This function sets a value in member tx_buf_write_pending_
 * @param _tx_buf_write_pending_ New value for member tx_buf_write_pending_
 */
void iridiumsbd_status::tx_buf_write_pending_(bool _tx_buf_write_pending_)
{
m_tx_buf_write_pending_ = _tx_buf_write_pending_;
}

/*!
 * @brief This function returns the value of member tx_buf_write_pending_
 * @return Value of member tx_buf_write_pending_
 */
bool iridiumsbd_status::tx_buf_write_pending_() const
{
    return m_tx_buf_write_pending_;
}

/*!
 * @brief This function returns a reference to member tx_buf_write_pending_
 * @return Reference to member tx_buf_write_pending_
 */
bool& iridiumsbd_status::tx_buf_write_pending_()
{
    return m_tx_buf_write_pending_;
}

/*!
 * @brief This function sets a value in member tx_session_pending_
 * @param _tx_session_pending_ New value for member tx_session_pending_
 */
void iridiumsbd_status::tx_session_pending_(bool _tx_session_pending_)
{
m_tx_session_pending_ = _tx_session_pending_;
}

/*!
 * @brief This function returns the value of member tx_session_pending_
 * @return Value of member tx_session_pending_
 */
bool iridiumsbd_status::tx_session_pending_() const
{
    return m_tx_session_pending_;
}

/*!
 * @brief This function returns a reference to member tx_session_pending_
 * @return Reference to member tx_session_pending_
 */
bool& iridiumsbd_status::tx_session_pending_()
{
    return m_tx_session_pending_;
}

/*!
 * @brief This function sets a value in member rx_read_pending_
 * @param _rx_read_pending_ New value for member rx_read_pending_
 */
void iridiumsbd_status::rx_read_pending_(bool _rx_read_pending_)
{
m_rx_read_pending_ = _rx_read_pending_;
}

/*!
 * @brief This function returns the value of member rx_read_pending_
 * @return Value of member rx_read_pending_
 */
bool iridiumsbd_status::rx_read_pending_() const
{
    return m_rx_read_pending_;
}

/*!
 * @brief This function returns a reference to member rx_read_pending_
 * @return Reference to member rx_read_pending_
 */
bool& iridiumsbd_status::rx_read_pending_()
{
    return m_rx_read_pending_;
}

/*!
 * @brief This function sets a value in member rx_session_pending_
 * @param _rx_session_pending_ New value for member rx_session_pending_
 */
void iridiumsbd_status::rx_session_pending_(bool _rx_session_pending_)
{
m_rx_session_pending_ = _rx_session_pending_;
}

/*!
 * @brief This function returns the value of member rx_session_pending_
 * @return Value of member rx_session_pending_
 */
bool iridiumsbd_status::rx_session_pending_() const
{
    return m_rx_session_pending_;
}

/*!
 * @brief This function returns a reference to member rx_session_pending_
 * @return Reference to member rx_session_pending_
 */
bool& iridiumsbd_status::rx_session_pending_()
{
    return m_rx_session_pending_;
}


size_t iridiumsbd_status::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;


















    return current_align;
}

bool iridiumsbd_status::isKeyDefined()
{
   return false;
}

void iridiumsbd_status::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
}
